{extend name="v1/layout/base"}
{block name="content"}
<style>
  .layui_xzwidth {
    width: 100% !important;
    margin-left: 0 !important;

  }
</style>
<div class="layui-row layui-col-space15">
  <div class="layui-col-md12">
    <form class="layui-card-body layui-form layui-form-pane">
      <!-- 需要购买的物品 -->
      <div class="layui-row layui-col-space10 layui-form-item">
        <div class="layui-col-lg8" style="color:#000;text-align: center;">
          <hr class="layui-border-red">产品信息
          <hr class="layui-border-red">
        </div>
      </div>
      <div class="layui-row layui-col-space10 layui-form-item">
        <div class="layui-col-lg8" style="color:#000;text-align: center;">
          <table class="layui-table " lay-size="lg">
            <thead>
              <tr>
                <th>产品名称</th>
                <th>产品单价</th>
                <th>购买数量</th>
                <th>产品规格</th>
              </tr>
            </thead>
            <tbody>
              {volist name="$info.orderGoods" id="vo"}
              {if condition="$vo['status'] == '1.1' || $vo['status'] == '5.12' || $vo['status'] == '5.22' || $vo['status'] == '5.32'"}
              <tr>
                <td>{$vo.goods_name} <input type="hidden" name="order_goods_id[]" value="{$vo.order_goods_id}" /></td>
                <td>{$vo.goods_price}</td>
                <td>{$vo.buy_num}</td>
                <td>{$vo.spec_value}</td>
              </tr>
              {/if}
              {/volist}
            </tbody>
          </table>
        </div>
      </div>
      <div class="layui-row layui-col-space10 layui-form-item">
        <div class="layui-col-lg8" style="color:#000;text-align: center;">
          <hr class="layui-border-red">物流信息
          <hr class="layui-border-red">
        </div>
      </div>
      <div class="layui-row layui-col-space10 layui-form-item">
        <div class="layui-col-lg8">
          <label class="layui-form-label">物流单号：</label>
          <div class="layui-input-block">
            <input type="hidden" name="company_name" id="company_name" value="">
            <input type="text" name="company_num" id="company_num" lay-verify="required" lay-reqtext="请填写物流单号" autocomplete="off" value="" class="layui-input">
          </div>
        </div>
      </div>

      <div class="layui-row layui-col-space10 layui-form-item">
        <div class="layui-col-lg8" style="color:#000;text-align: center;">
          <hr class="layui-border-red">操作
          <hr class="layui-border-red">
        </div>
      </div>



      <!-- 底部操作按钮 -->
      <div class="layui-row">
        <div class="layui-col-xs2">&nbsp;</div>
        <div class="layui-col-xs5">
          <button type="button" class="layui-btn layui-btn-primary layui-btn-radius" id="backList"><i class="layui-icon">&#xe65c;</i>返回列表</button>
          <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit lay-filter="delivery"><i class="layui-icon">&#xe609;</i>订单发货</button>
        </div>
        <div class="layui-col-xs5">&nbsp;</div>
      </div>
      <!-- 底部操作按钮结束 -->
    </form>
  </div>
</div>
{/block}
{block name="myScript"}
<script>
  layui.use(['form'], function() {
    var form = layui.form,
      layer = layui.layer,
      $ = layui.$;
    form.on('submit(delivery)', function(data) {
      var sub_order_sn = '{$sub_order_sn}',
        data = data.field,
        url = "/{:config("manage.manage_name")}/{:config("manage.version")}/Order/doDelivery";
        console.log(url);
        data.sub_order_sn = sub_order_sn;
      https(url, data, 'post', 1, '正在执行发货').then(res => {
        xkBackMsg(res.result_msg);
      })
    })
    form.on("select(chooseCompany)", function(data) {
      var company_name = $(data.elem).find("option:selected").attr("data-company_name");
          $("#company_name").val(company_name);
    })
  });
</script>
{/block}
